function [detectionRate falsePositiveRate overallAccuracy]=evaluateSegmentaion(segmentationFilename,grounTruthFilename)
im1=load_nifti(segmentationFilename);
im2=load_nifti(grounTruthFilename);
if sum(size(im1)==size(im2))~=3
    disp('Images do not have the same spatial dimensions!')
    detectionRate=NaN;
    falsePositiveRate=NaN;
    return;
end
im3=im1&im2;
im3=(im3>0);
detectionRate=sum(im3(:))/sum(im2(:));
im3=im1&(~im2);
im3=(im3>0);
falsePositiveRate=sum(im3(:))/sum(im1(:));
if falsePositiveRate>1
	falsePositiveRate=1;
end
overallAccuracy=detectionRate*(1-falsePositiveRate);